import { AxiosResponse } from 'axios';
import { Get, Post } from '../axios';



/* 删除超级签 */
interface DelsuperInterface {
    (data: {
        id: string,                     /*超级签id*/
    }): Promise<AxiosResponse<any>>
}
export const delsuper: DelsuperInterface = async (data) => {
    try {
        return await Post({ url: "/supermod/delsuper", data });
    } catch (error) {
        throw error
    }
}



/* 修改超级签 */
interface UpsuperInterface {
    (data: {
        id: string,                    /* 超级签id */
        remarks?: string,              /* 备注 */
        merge?: string,                /* 合并参数 */
        codestatus?: boolean,          /* 是否需要下载码 */
        accountPool?: string           /* 证书池 */
    }): Promise<AxiosResponse<any>>
}
export const upsuper: UpsuperInterface = async (data) => {
    try {
        return await Post({ url: "/supermod/upsuper", data });
    } catch (error) {
        throw error
    }
}



/* 查询超级签 */
interface GetsuperInterface {
    (data: {
        pageNo: number,                    /* 当前页数 */
        pageSize: number,                  /* 页面总条数 */
        id?: string | null
    }): Promise<AxiosResponse<any>>
}
export const getsuper: GetsuperInterface = async (data) => {
    try {
        return await Post({ url: "/supermod/getsuper", data });
    } catch (error) {
        throw error
    }
}



/* 搜索超级签 */
interface SchsuperInterface {
    (data: {
        remarks: string                     /*备注*/
    }): Promise<AxiosResponse<any>>
}
export const schsuper: SchsuperInterface = async (data) => {
    try {
        return await Get({ url: "/supermod/schsuper", data });
    } catch (error) {
        throw error
    }
}



/* 搜索超级签 */
interface updateMobileInterface {
    (data: {
        apptype: string
        lid: string
        userid: string
    }): Promise<AxiosResponse<any>>
}
export const updateMobile: updateMobileInterface = async (data) => {
    try {
        return await Post({ url: "/supermod/updateMobile", data });
    } catch (error) {
        throw error
    }
}
